/*
 * $Id: DefaultBooleanFormatter.java 66 2013-01-06 10:16:51Z vladimirow@mail.ru $
 * $HeadURL: http://ultralog.googlecode.com/svn/ultralog/trunk/src/java/com/google/code/ultralog/formatter/def/DefaultBooleanFormatter.java $
 *
 * This file is a part of ultralog project (http://code.google.com/p/ultralog/).
 * Released under New BSD License.
 */
package com.google.code.ultralog.formatter.def;

import com.google.code.ultralog.formatter.BooleanFormatter;
import com.google.code.ultralog.utils.CharacterOutputStream;

/**
 * Default implementation of {@link BooleanFormatter} interface.
 *
 * @author Mikhail Vladimirov
 */
public class DefaultBooleanFormatter implements BooleanFormatter
{
    /**
     * Singleton instance of the formatter.
     */
    public final static DefaultBooleanFormatter INSTANCE =
        new DefaultBooleanFormatter ();

    private DefaultBooleanFormatter ()
    {
        // Do nothing
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void format (boolean value, CharacterOutputStream output)
    {
        String stringValue = Boolean.toString (value);
        output.write (stringValue, 0, stringValue.length ());
    }
}
